/**
 * @FileName: ThemeController.java
 * @Author
 * @Description:
 * @Date 2016年1月4日 下午5:53:11
 * @CopyRight ZTE Corporation
 */
package cn.hpclub.server.controller.h5;

import java.io.IOException;

import org.json.JSONObject;

import cn.hpclub.server.constant.H5ApiConstant;
import cn.hpclub.server.service.RedirectService;

public class RedirectController extends BaseH5Controller implements H5ApiConstant{

    public void business(){
        try{
            String url = RedirectService.service.getRedirectUrl(this.getPara("para"));
            JSONObject jo = setResponseObj(H5ApiConstant.ResultCode.SUCCESS_CODE, H5ApiConstant.Msg.SUCCESS, url);
            renderText(jo.toString());
        }
        catch(IOException e){
            e.printStackTrace();
            JSONObject jo = setResponseObj(H5ApiConstant.ResultCode.EXCEPTION_CODE, e.getMessage(), null);
            renderText(jo.toString());
        }
        catch(Exception e){
            e.printStackTrace();
            JSONObject jo = setResponseObj(H5ApiConstant.ResultCode.EXCEPTION_CODE, H5ApiConstant.Msg.EXCEPTION, null);
            renderText(jo.toString());
        }
    }

}
